package com.yy.dao.impl;

import com.yy.dao.UserDao;
import com.yy.db.UserDBUtil;
import com.yy.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserDaoImpl implements UserDao {

    @Override
    public User login(User user) {
        //TODO  jdb操作数据库
        UserDBUtil userDBUtil=new UserDBUtil();
        User login = userDBUtil.login(user);
        System.out.println("登陆成功");

        return login;
    }

    @Override
    public boolean nicknameExist(String nickname) {
        UserDBUtil userDBUtil=new UserDBUtil();
        return userDBUtil.nicknameExist(nickname);
    }

    @Override
    public boolean addUser(User user) {
        UserDBUtil userDBUtil=new UserDBUtil();
        return userDBUtil.addUser(user);
    }
}
